﻿using Estsh.Core.Wms.IServices;
using Estsh.Core.Model.Result;
using Estsh.Core.Util;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Estsh.Core.Models;
using Estsh.Core.Model.Extend.Models;
using Microsoft.AspNetCore.Authorization;
using Estsh.Core.Controllers;
using Newtonsoft.Json;
using Estsh.Core.Model.Extend;
using Estsh.Core.Model.Extend.Models;

namespace Estsh.Core.Web.Plugin.Wms.Areas.wms.Controllers.Move
{
    [Route("wms/[controller]")]
    [ApiController]
    public class MoveController : Controller
    {
        private IMoveService service;

        // GET: LoginController
        public MoveController(IMoveService _service)
        {
            service = _service;
        }


        /// <summary>
        /// 判断库位
        /// </summary>
        /// <returns>工厂代码1002</returns>
        [HttpPost("CheckLocateName")]
        public IActionResult CheckLocateName(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string locateName = jobj["locateName"].ToString().Trim();
            string isPack = jobj["isPack"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string obj = service.CheckLocateName(loginId, locateName, isPack);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        /// <summary>
        /// 执行移库操作
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckMove")]
        public IActionResult CheckMove(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string locateName = jobj["locateName"].ToString().Trim();
            string isPack = jobj["isPack"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string obj = service.CheckMove(loginId, cartonNo, locateName, isPack);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        /// <summary>
        /// 扫描周转箱
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckContainer")]
        public IActionResult CheckContainer(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string isHandover = jobj["isHandover"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.CheckContainer(loginId, rackNo, isHandover);               
                    result.Success = true;
                    result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        /// <summary>
        /// 扫描箱条码
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckBarcode")]
        public IActionResult CheckBarcode(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string locateName = jobj["locateName"].ToString().Trim();
            string isHandover = jobj["isHandover"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                SetObjectDetail obj = service.CheckBarcode(loginId,cartonNo,locateName,isHandover, rackNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 获取扫描条码的信息
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("GetCheckCartNoInfo")]
        public IActionResult GetCheckCartNoInfo(Newtonsoft.Json.Linq.JObject jobj)
        {
            string rackNo = jobj["rackNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                List<WmsRackPackage_Extend> obj = service.GetCheckCartNoInfo(rackNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        [HttpPost("GetMovePartInfo")]
        public IActionResult GetMovePartInfo(Newtonsoft.Json.Linq.JObject jobj)
        {
            string isPack = jobj["isPack"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                List<SysStock> obj = service.GetMovePartInfo(cartonNo, isPack);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        [HttpPost("GetMoveOrderList")]
        public IActionResult GetMoveOrderList(Newtonsoft.Json.Linq.JObject jobj)
        { 
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string cartonno = jobj["cartonno"].ToString();
                List<WmsMoveHeader> obj = service.GetMoveOrderList(cartonno);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        [HttpPost("CheckMoveOrderLocateName")]
        public IActionResult CheckMoveOrderLocateName(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string locateName = jobj["locateName"].ToString().Trim();
            string orderNo = jobj["orderNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string obj = service.CheckMoveOrderLocateName(loginId, locateName, orderNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        [HttpPost("CheckCartonMoveOrder")]
        public IActionResult CheckCartonMoveOrder(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string locateName = jobj["locateName"].ToString().Trim();
            string orderNo = jobj["orderNo"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string obj = service.CheckCartonMoveOrder(loginId, cartonNo, locateName, orderNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        [HttpPost("GetMoveOrderDetailList")]
        public IActionResult GetMoveOrderDetailList(Newtonsoft.Json.Linq.JObject jobj)
        {
            string orderNo = jobj["orderNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                List<WmsMoveDetail> obj = service.GetMoveOrderDetailList(orderNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        [HttpPost("ChangeMoveHeaderStatus")]
        public IActionResult ChangeMoveHeaderStatus(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim(); 
            string orderNo = jobj["orderNo"].ToString().Trim(); 
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string obj = service.ChangeMoveHeaderStatus(loginId,  orderNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }



        #region 移库单配料


        [HttpPost("GetRackPartNo")]
        public IActionResult GetRackPartNo(Newtonsoft.Json.Linq.JObject jobj)
        {
            string rackNo = jobj["rackNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                List<WmsRackPackage_Extend> obj = service.GetRackPartNo(rackNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        /// <summary>
        /// 获取列表信息刷新
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("GetRackPackageList")]
        public IActionResult GetRackPackageList(Newtonsoft.Json.Linq.JObject jobj)
        {
            //string loginId = jobj["loginId"].ToString().Trim();
            string isSplit = jobj["isSplit"].ToString().Trim();
            string cartNo = jobj["cartonNo"].ToString().Trim();
            //string orderNo = jobj["orderNo"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.GetRackPackageList(cartNo, isSplit);
                result.Success = true;
                result.Data = obj;

            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 不拆箱-扫描箱条码或周转箱
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckCartonOrRack")]
        public IActionResult CheckCartonOrRack(Newtonsoft.Json.Linq.JObject jobj)
        {
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            string orderNo = jobj["orderNo"].ToString().Trim();
            string isSplit = jobj["isSplit"].ToString().Trim();
            string loginId = jobj["loginId"].ToString().Trim();

            WmsResponseResult result = new WmsResponseResult();
            try
            {
                SetObjectDetail obj = service.CheckCartonOrRack(cartonNo, orderNo, isSplit, loginId);
                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        /// <summary>
        /// 拆箱-扫描周转箱
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckRackNo")]
        public IActionResult CheckRackNo(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string isSplit = jobj["isSplit"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            string orderNo = jobj["orderNo"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.CheckRackNo(loginId, rackNo, isSplit, orderNo);
                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 拆箱-扫描箱条码或周转箱
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckCartNo")]
        public IActionResult CheckCartNo(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string isSplit = jobj["isSplit"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            string cartNo = jobj["cartonNo"].ToString().Trim();
            string orderNo = jobj["orderNo"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.CheckCartNo(loginId, isSplit, cartNo, orderNo, rackNo);
                result.Success = true;
                result.Data = obj;

            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }



        /// <summary>
        /// 拆箱-输入拆分数量
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckSplitQty")]
        public IActionResult CheckSplitQty(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string isSplit = jobj["isSplit"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            string rackOrCartNo = jobj["rackOrCartNo"].ToString().Trim();
            string cartNo = jobj["cartonNo"].ToString().Trim();
            string orderNo = jobj["orderNo"].ToString().Trim();
            string SplitQty= jobj["SplitQty"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.CheckSplitQty(loginId,  isSplit, cartNo, orderNo, rackNo, SplitQty, rackOrCartNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }




        #endregion


        #region 移库单接收

        [HttpPost("GetMoveSourceOrderList")]
        public IActionResult GetMoveSourceOrderList(Newtonsoft.Json.Linq.JObject jobj)
        {
            string orderNo = jobj["orderNo"].ToString().Trim();

            WmsResponseResult result = new WmsResponseResult();
            try
            {
                SetObjectDetail obj = service.GetMoveSourceOrderList(orderNo);
                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        [HttpPost("GetMoveSourceListByOrderNo")]
        public IActionResult GetMoveSourceListByOrderNo(Newtonsoft.Json.Linq.JObject jobj)
        {
            string orderNo = jobj["orderNo"].ToString().Trim();

            WmsResponseResult result = new WmsResponseResult();
            try
            {
                SetObjectDetail obj = service.GetMoveSourceListByOrderNo(orderNo);
                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 扫描箱条码或周转箱
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckRackMoveOrder")]
        public IActionResult CheckRackMoveOrder(Newtonsoft.Json.Linq.JObject jobj)
        {
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            string orderNo = jobj["orderNo"].ToString().Trim();
            string locateName = jobj["locateName"].ToString().Trim();
            string loginId = jobj["loginId"].ToString().Trim();

            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string obj = service.CheckRackMoveOrder(cartonNo, orderNo, locateName, loginId);
                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 提交完成单据至ERP
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("SubmitMoveOrderGoERP")]
        public IActionResult SubmitMoveOrderGoERP(Newtonsoft.Json.Linq.JObject jobj)
        {
            string orderNo = jobj["orderNo"].ToString().Trim();
            string loginId = jobj["loginId"].ToString().Trim();

            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string obj = service.SubmitMoveOrderGoERP(orderNo);
                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }



        #endregion


        #region 翻箱

        /// <summary>
        /// 拆分
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("ScanSplitQty")]
        public IActionResult ScanSplitQty(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            string rackOrCartNo = jobj["rackOrCartNo"].ToString().Trim();
            string SplitQty = jobj["SplitQty"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.ScanSplitQty(loginId,rackNo,rackOrCartNo,SplitQty, cartonNo);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        #endregion


        #region 组托

        
        /// <summary>
        /// 刷新
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("GetShowList")]
        public IActionResult GetShowList(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.GetShowList(loginId, rackNo);
                result.Success = true;
                result.Data = obj;

            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        /// <summary>
        /// 扫描托条码
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckTorr")]
        public IActionResult CheckTorr(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.CheckTorr(loginId, rackNo);             
                result.Success = true;
                result.Data = obj;

            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }



        /// <summary>
        /// 扫描条码（托/周转箱/物料箱条码）
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckLotGroupBarcode")]
        public IActionResult CheckLotGroupBarcode(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string isGroup = jobj["isGroup"].ToString().Trim();
            string rackNo = jobj["rackNo"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                SetObjectDetail obj = service.CheckLotGroupBarcode(rackNo, cartonNo, isGroup, loginId );

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 拆分
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckLotGroupSplitQty")]
        public IActionResult CheckLotGroupSplitQty(Newtonsoft.Json.Linq.JObject jobj)
        {        
            string rackNo = jobj["rackNo"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            string rackOrcartNo = jobj["rackOrCartNo"].ToString().Trim();
            string isGroup = jobj["isGroup"].ToString().Trim();
            string SplitQty = jobj["SplitQty"].ToString().Trim();
            string loginId = jobj["loginId"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.CheckLotGroupSplitQty(rackNo, cartonNo, rackOrcartNo,isGroup,  SplitQty, loginId);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }



        #endregion


        #region 线边退料

        [HttpPost("GetReturnMaterialInfo")]
        public IActionResult GetReturnMaterialInfo(Newtonsoft.Json.Linq.JObject jobj)
        {
            string onLine = jobj["onLine"].ToString();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                List<WmsMoveHeader> obj = service.GetReturnMaterialInfo(onLine);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 退料-扫描条码（周转箱/物料箱条码）
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckReturnMaterialBarcode")]
        public IActionResult CheckReturnMaterialBarcode(Newtonsoft.Json.Linq.JObject jobj)
        {
            string loginId = jobj["loginId"].ToString().Trim();
            string rackOrcartNo = jobj["rackOrcartNo"].ToString().Trim();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                SetObjectDetail obj = service.CheckReturnMaterialBarcode(rackOrcartNo, loginId);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 退料-拆分
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckReturnMaterialSplitQty")]
        public IActionResult CheckReturnMaterialSplitQty(Newtonsoft.Json.Linq.JObject jobj)
        {
            string orderNo = jobj["orderNo"].ToString().Trim();
            string rackOrcartNo = jobj["rackOrcartNo"].ToString().Trim(); 
            string cartonNo = jobj["cartonNo"].ToString().Trim();          
            string SplitQty = jobj["SplitQty"].ToString().Trim();
            string loginId = jobj["loginId"].ToString().Trim();
            WmsResponseResult_Extend result = new WmsResponseResult_Extend();
            try
            {
                SetObjectDetail obj = service.CheckReturnMaterialSplitQty(orderNo, rackOrcartNo, cartonNo , SplitQty, loginId);
                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }


        /// <summary>
        /// 退料-扫描目标库位
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckReturnMaterialLocate")]
        public IActionResult CheckReturnMaterialLocate(Newtonsoft.Json.Linq.JObject jobj)
        {
            string locate = jobj["locate"].ToString();
            string orderNo = jobj["orderNo"].ToString().Trim();
            string rackOrcartNo = jobj["rackOrcartNo"].ToString().Trim();
            string cartonNo = jobj["cartonNo"].ToString().Trim();
            string SplitQty = jobj["SplitQty"].ToString().Trim();
            string loginId = jobj["loginId"].ToString().Trim();
            string locateName = jobj["locateName"].ToString();
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                SetObjectDetail obj = service.CheckReturnMaterialLocate(locateName, orderNo, rackOrcartNo, cartonNo, SplitQty, locate, loginId);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }



        #endregion


        #region （空）周转箱出入库


        /// <summary>
        /// 扫描空周转箱
        /// </summary>
        /// <param name="jobj"></param>
        /// <returns></returns>
        [HttpPost("CheckStockRackNo")]
        public IActionResult CheckStockRackNo(Newtonsoft.Json.Linq.JObject jobj)
        {
            WmsResponseResult result = new WmsResponseResult();
            try
            {
                string loginId = jobj["loginId"].ToString().Trim();
                string locateName = jobj["locateName"].ToString().Trim();
                string isOut = jobj["isOut"].ToString().Trim();
                string rackNo = jobj["rackNo"].ToString().Trim();
                
                SetObjectDetail obj = service.CheckStockRackNo(locateName, rackNo, isOut, loginId);

                result.Success = true;
                result.Data = obj;
            }
            catch (Exception ex)
            {
                result.Msg = ex.Message;
            }
            return Json(result);
        }

        #endregion


    }
}
